package com.scroll.demo.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.scroll.demo.R;
import com.scroll.demo.bean.ClassBean;
import com.scroll.demo.widget.HorizontalRecyclerView;

import java.util.List;

/**
 * <pre>
 *     project name: RecyclerViewInRecyclerView-master
 *     author      : 李琼
 *     create time : 2018/1/30 下午10:35
 *     desc        : 描述--//VerticalAdapter
 *     Reference   :
 *     modifier               :
 *     modification time      :
 *     modify remarks         :
 *     @version: --//1.0
 * </pre>
 */


public class VerticalAdapter extends BaseQuickAdapter<ClassBean, BaseViewHolder>{


    public VerticalAdapter(@Nullable List<ClassBean> dataSet) {
        super(R.layout.item_vertical, dataSet);
    }


    @Override
    protected void convert(BaseViewHolder helper, ClassBean item) {
        helper.setText(R.id.vertical_text, item.getClassName());

        HorizontalRecyclerView mHorizontalRecyclerView = helper.getView(R.id.horizontal_recyclerview);
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mContext,LinearLayoutManager.HORIZONTAL,false);
        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        mHorizontalRecyclerView.setLayoutManager(linearLayoutManager);
        mHorizontalRecyclerView.setAdapter(new HorizontalAdapter(item.getStudentBeans()));
    }


}
